package com.dime.basic.api;

import com.dime.basic.api.domain.DimeBasegroup;
import com.dime.basic.api.factory.RemoteGroupFallbackFactory;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(contextId = "remoteGroupService", value = ServiceNameConstants.DM_BASIC, fallbackFactory = RemoteGroupFallbackFactory.class)
public interface RemoteGroupService {

    @GetMapping("/basegroup/info/groups/{ids}")
    public R<List<DimeBasegroup>> getGroupsbyIds(@PathVariable("ids") String[] ids);

    @GetMapping("/basegroup/info/groupUser/{userId}")
    public R<List<DimeBasegroup>> getGroupByUserId(@PathVariable("userId") String userId);

    @GetMapping("/basegroup/info/getallgroup")
    public R<List<DimeBasegroup>> getallgroup();
}
